package com.carbon.trade.common;


import com.carbon.domain.common.ApiResult;
import com.carbon.trade.entity.CarbonTradeQuote;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.math.BigDecimal;

// 在 carbon-trade 模块中创建
@FeignClient(name = "carbon-assets", url = "${carbon.assets.url:http://localhost:9003/assets}")
public interface CarbonCreditFeignClient {
    
    @GetMapping("/carbonCreditAssets/queryTotal/{projectId}")
    ApiResult<BigDecimal> queryTotal(@PathVariable("projectId") Long projectId);
    @PostMapping("/carbonCreditAssets/updateAmount")
    ApiResult updateAmount(@RequestBody CarbonTradeQuote carbonTradeQuote);

    @GetMapping("/carbonQuotaAssets/queryTotal/{projectId}")
    ApiResult<BigDecimal> queryTotalQuota(@PathVariable("projectId") Long projectId);

    @PostMapping("/carbonQuotaAssets/updateAmount")
    ApiResult updateAmountQuota(@RequestBody CarbonTradeQuote carbonTradeQuote);
}
